﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using CRC.NHibernate;

namespace CRC.Inspecciones.Dominio.Controlador
{
    class CtrlZona
    {
        private static String strQryZonas = "select z.Id, z.Nombre from Zona z order by z.Nombre";
        
        public IList<Object[]> ObtenerZonas()
        {
            ISession session = null;
            IList<Object[]> zonas = null;

            try
            {
                session = NHibernateHelper.GetCurrentSession();

                zonas = session.CreateQuery(strQryZonas).List<Object[]>();
                return zonas;
            }
            catch (HibernateException ex)
            {
                session.Close();
                throw ex;
            }
        }
    }
}
